package cn.elwy.rcp.ui.composite;

import java.util.Date;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.DateTime;

/**
 * @author HSQ
 */
public class MyDateTime extends Composite {

  DateTime dateTime;
  DateTime dateTime_1;

  /**
   * Create the composite.
   * 
   * @param parent
   * @param style
   */
  public MyDateTime(Composite parent, int style) {
    super(parent, style);
    setLayout(new GridLayout(2, false));

    dateTime = new DateTime(this, SWT.BORDER | SWT.DROP_DOWN);
    dateTime_1 = new DateTime(this, SWT.BORDER | SWT.TIME);
  }

  @Override
  protected void checkSubclass() {
    // Disable the check that prevents subclassing of SWT components
  }

  public void setDateTime(String date) {
  }

  public void setDateTime(Date date) {
  }

  public String formatDateTime() {
    return dateTime.getYear() + "-" + dateTime.getMonth() + "-" + dateTime.getDay();
  }

}
